package mysql

import "gorm.io/gorm"

type Docker struct {
	gorm.Model
	DockerName   string `gorm:"type:varchar(20)" json:"dockerName"` //医生姓名
	HospitalId   int64  `gorm:"type:int(10)" json:"hospitalId"`     //医院id
	DepartmentId int64  `gorm:"type:int(10)" json:"departmentId"`   //科室id
	IsDuty       int64  `gorm:"type:int(3)" json:"isDuty"`          //是否值班
}

func (d *Docker) FindDocker(isDuty int64) (decker []*Docker, err error) {
	err = DB.Where("is_duty =?", isDuty).Find(&decker).Error
	if err != nil {
		return nil, err
	}
	return decker, nil
}
